-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Migrate AbstractMessageManager
from BaseControllerV1
to BaseControllerV2
#5103
fix: Migrate AbstractMessageManager
from BaseControllerV1
to BaseControllerV2
#5103
Conversation
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
fb4b210
to
b901514
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
This also closes one of the items in #1509. |
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> New RC for the `284.0.0` ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/[email protected]` #### Changed - **BREAKING:** Base class of `DecryptMessageManager` and `EncryptionPublicKeyManager`(`AbstractMessageManager`) now expects new options to initialise ([#5103](#5103)) - Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.0` ([#5079](#5079)) #### Removed - **BREAKING:** Removed internal event emitter (`hub` property) from `AbstractMessageManager` ([#5103](#5103)) - **BREAKING:** `unapprovedMessage` and `updateBadge` removed from internal events. These events are now emitted from messaging system ([#5103](#5103)) - Controllers should now listen to `DerivedManagerName:X` event instead of using internal event emitter. ### `@metamask/[email protected]` #### Changed - Bump `@metamask/eth-snap-keyring` from `^8.0.0` to `^8.1.0` ([#5167](#5167)) ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: Charly Chevalier <[email protected]>
…tend controllers (#29237) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to adapt latest changes in the `@metamask/message-manager` `DecryptMessageManager` and `EncryptionPublicKeyManager` classes. The latest change in core mainly tries to adapt `BaseControllerV2`. Hence in the extension, minimum changes made in the wrapper classes to keep functionality as is. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29237?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3747 Related core PR: MetaMask/core#5103 ## **Manual testing steps** 1. Go to test-dapp and `Encrypt / Decrypt` section 2. "Get Encryption Key", "Encrypt" and "Decrypt" must be functional and work without issue ## **Screenshots/Recordings** https://github.com/user-attachments/assets/3857cb34-2542-41c3-ac1e-6d95e98b0dfb ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
…tend controllers (#29237) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to adapt latest changes in the `@metamask/message-manager` `DecryptMessageManager` and `EncryptionPublicKeyManager` classes. The latest change in core mainly tries to adapt `BaseControllerV2`. Hence in the extension, minimum changes made in the wrapper classes to keep functionality as is. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29237?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3747 Related core PR: MetaMask/core#5103 ## **Manual testing steps** 1. Go to test-dapp and `Encrypt / Decrypt` section 2. "Get Encryption Key", "Encrypt" and "Decrypt" must be functional and work without issue ## **Screenshots/Recordings** https://github.com/user-attachments/assets/3857cb34-2542-41c3-ac1e-6d95e98b0dfb ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
…tend controllers (#29237) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to adapt latest changes in the `@metamask/message-manager` `DecryptMessageManager` and `EncryptionPublicKeyManager` classes. The latest change in core mainly tries to adapt `BaseControllerV2`. Hence in the extension, minimum changes made in the wrapper classes to keep functionality as is. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29237?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3747 Related core PR: MetaMask/core#5103 ## **Manual testing steps** 1. Go to test-dapp and `Encrypt / Decrypt` section 2. "Get Encryption Key", "Encrypt" and "Decrypt" must be functional and work without issue ## **Screenshots/Recordings** https://github.com/user-attachments/assets/3857cb34-2542-41c3-ac1e-6d95e98b0dfb ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
Explanation
This PR aims to remove
BaseControllerV1
usage fromAbstractMessageManager
. As expected this change affected bothDecryptMessageManager
(DMM
) andEncryptionPublicKeyManager
(EPKM
).Since extension already have wrapper classes for both
DMM
&EPKM
in the extension code, we want to keep changes minimal and make these both classes in the core work like controller but let wrappers sync the state in their classes as we currently do. You can find the extension PR in the references below.References
DecryptMessageManager
EncryptMessageManager
to extend controllers metamask-extension#29237Changelog
@metamask/message-manager
DecryptMessageManager
andEncryptionPublicKeyManager
(AbstractMessageManager
) now expects new options to initialisehub
property) fromAbstractMessageManager
unapprovedMessage
andupdateBadge
removed from internal events. These events are now emitted from messaging systemDerivedManagerName:X
event instead of using internal event emitter.Checklist